Skip to content

iio: light: add ams TCS3430 ALS driver and enable on Surface Pro X - #204

Open
robertijtsma wants to merge 3 commits into
linux-surface:spx/v7.3from
robertijtsma:spx-iio-tcs3430
Open

robertijtsma wants to merge 3 commits into
linux-surface:spx/v7.3from
robertijtsma:spx-iio-tcs3430

Conversation

@robertijtsma

Copy link
Copy Markdown

Resolves the // TODO: this should actually be a TCS3430 in sc8180x-surface-pro-x.dts by adding an upstream-style IIO driver and DT binding for the ams OSRAM TCS3430 ambient light / XYZ color sensor at i2c2@0x39.

Commits

  1. dt-bindings: iio: light: add ams TCS3430: adds Documentation/devicetree/bindings/iio/light/ams,tcs3430.yaml.
  2. iio: light: add ams TCS3430 ambient light and XYZ color sensor driver: adds drivers/iio/light/tcs3430.c (CONFIG_TCS3430), exposing processed photopic light intensity alongside raw Z, Y, IR1, and X channels, automatic 1x..64x gain stepping, integration time, and DEFINE_SIMPLE_DEV_PM_OPS suspend/resume power management.
  3. arm64: dts: qcom: sc8180x-surface-pro-x: switch ALS compatible to ams,tcs3430: updates als@39 from avago,apds9960 to ams,tcs3430.

Verification

  • All 3 commits pass scripts/checkpatch.pl with 0 errors and 0 style warnings.
  • tcs3430.ko builds cleanly with make W=1 against 7.3.1-1-surface (0 warnings).
  • sc8180x-surface-pro-x.dts preprocesses and compiles cleanly with dtc.
  • Live-tested on Microsoft Surface Pro X SQ2 (SC8180X, chip ID 0xdc) across normal operation and s2idle suspend/resume.

Add Devicetree binding schema for the ams OSRAM TCS3430 ambient light
and CIE 1931 XYZ tristimulus color sensor.

Signed-off-by: robertijtsma <37256770+robertijtsma@users.noreply.github.com>
Add an IIO driver for the ams OSRAM TCS3430 ambient light and XYZ
tristimulus color sensor (present at I2C address 0x39 on the Microsoft
Surface Pro X).

Exposes processed photopic light intensity alongside raw Z, Y, IR1,
and X intensity channels, automatic 1x..64x gain stepping, integration
time reporting, and system suspend/resume power management.

Tested on Microsoft Surface Pro X SQ2 (SC8180X, Linux 7.3.1-1-surface).

Signed-off-by: robertijtsma <37256770+robertijtsma@users.noreply.github.com>
…,tcs3430

The ambient light sensor at 0x39 on i2c2 is an ams OSRAM TCS3430
(chip ID 0xdc), not an Avago APDS9960. Update the compatible string
to ams,tcs3430.

Signed-off-by: robertijtsma <37256770+robertijtsma@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant